package mvc.view
{
	import flash.events.Event;
	import mx.events.FlexEvent;
	
	import mvc.view.components.DefaultView;
	import org.puremvc.as3.patterns.mediator.Mediator;
	import org.tools.att.Att;

	public class DefaultViewMediator extends Mediator
	{
        public static const NAME:String = 'DefaultViewMediator';
        public function		DefaultViewMediator	( viewComponent:Object ){onTrace("	"+this);super( NAME, viewComponent );}
		private	function	onTrace(...args):void{Att.send('bTrace',String(Object(this).constructor),args);}
		override public function onRemove():void
		{
			onTrace("#	onRemove	"+defaultView);
			super.onRemove();
		}
		override public function onRegister():void
		{
			onTrace("	onRegister	"+defaultView);
//			defaultView.addEventListener(FlexEvent.HIDE, onHide);
		}
		protected function onHide(event:Event):void
		{
			onTrace("	onHide");
//			defaultView.removeEventListener(FlexEvent.HIDE, onHide);
		}   
        protected function get defaultView():DefaultView{return viewComponent as DefaultView;}
	}
}